/*
 *The code is written by 51jiecai.com.
 *All rights reserved.
 */
package creational.design.patterns.singleton;

/**
 *
 *@author forgkan Created on 2015年4月23日
 *
 */
public class ThreadSafeDoubleCheckSingleton {

	private static ThreadSafeDoubleCheckSingleton instance ;
	
	private ThreadSafeDoubleCheckSingleton() {
	}
	
	
	public static synchronized ThreadSafeDoubleCheckSingleton getInstance() {
		if(instance == null) {
			synchronized (ThreadSafeDoubleCheckSingleton.class) {
				if(instance == null) {
					instance = new ThreadSafeDoubleCheckSingleton();
				}
			}
		}
		
		return instance;
	}
	
}
